home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 869 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.7 KB  |  42 lines

  1. Path: cs.mu.OZ.AU!bounce-back
  2. From: willer@carolian.com (Steve Willer)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Quick questions
  5. Date: 27 Mar 96 03:10:04 GMT
  6. Organization: Carolian Systems, Toronto ON
  7. Approved: fjh@cs.mu.oz.au
  8. Message-ID: <m0u1ddY-000Cb3C@sqarc.sq.com>
  9. References: <4j5b26$1e7a@mule1.mindspring.com> <4j7a64$l9i@engnews1.Eng.Sun.COM>
  10. NNTP-Posting-Host: munta.cs.mu.oz.au
  11. X-Original-Date:      Tue, 26 Mar 96 13:38 EST
  12. X-Newsreader: Forte Agent .99d/32.182
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBFAgUBMVixn+EDnX0m9pzZAQGJ4wF7B29IxpjgSWLlj3hII2+mZ60GTMfxICUE
  15.     XV2g5Aws3G8toDmDtzKrXYeUHHUiGDnV
  16.     =R8qL
  17. Originator: fjh@munta.cs.mu.OZ.AU
  18.  
  19. clamage@Eng.sun.com (Steve Clamage) wrote:
  20.  
  21. >>2) From a previous post on this group, it looks like the standard will
  22. >>allow one to define conversion operators for pre-existing, source code
  23. >>untouchable data types.  Yes? No? What will this look like? I have the
  24. >>May copy of the WP, and don't see any mention of this.
  25. >
  26. >I'm not sure I understand what you are asking. If you mean can you define
  27. >a conversion operator from a user-defined class to a predefined type
  28. >like int or double, then yes, that has long been part of C++.
  29.  
  30. I believe he was referring to something like
  31.  
  32. class myclass{};
  33. operator int(const myclass &arg);
  34.  
  35. Just like the global equality operators, etc.
  36. ---
  37. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  38. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  39. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  40. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  41. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  42.